import { ISynonymWord } from '../../../designer/service';
import { TextWidget } from '@inbiz/react';
function SynonymWord({
  list,
  onClick,
}: {
  list?: ISynonymWord[];
  onClick?: (data: ISynonymWord) => void;
}) {
  return (
    <div className="synonymWord">
      <p>
        <TextWidget>SearchResultEngine.similarSearch</TextWidget>:
      </p>
      {list?.map((item, index) => {
        return (
          <a
            className="synonymWord-item"
            onClick={() => onClick?.(item)}
            key={`${item.Representation.WordOrNull}_${index}`}
          >
            {item.Representation.WordOrNull}
          </a>
        );
      })}
    </div>
  );
}

export default SynonymWord;
